package org.example.forum.exception;

import lombok.Data;
import org.example.forum.common.AppResult;


/**
 * 自定义异常类
 */

@Data
public class ApplicationException extends RuntimeException {
    protected AppResult errorResult;

    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public ApplicationException() {
        super();
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }
}
